/**
 * 详情
 * @constructor
 */
function Details3() {
}

Details3.init = function () {

    $('#qyxxtable').bootstrapTable({
        url: '/harmlessenterprise/tableSearchMe/'+$("#kkk").val(),
        method: 'post',
        toolbar: "#toolbar",
        sidePagination: 'server',
        dataField: "data",
        striped: true,
        pagination: true,
        pageNumber: 1,
        pageSize: 10,
        pageList: [10, 25, 50, 100],
        sortable: true,
        sortName: 'createDateTime',
        sortOrder: "desc",
        search: false,
        showRefresh: true,
        showColumns: true,
        showExport: true,
        showToggle: true,
        queryParamsType: 'undefined',
        queryParams: function queryParams(params) {
            return {
                pageSize: params.pageSize,      //页面大小
                pageIndex: params.pageNumber,   //页码
                sort: params.sortName,      //排序列名
                sortOrder: params.sortOrder, //排位命令（desc，asc）
                enterpriseName: $("#enterpriseNameCondition").val(),
                userName: $("#userNameCondition").val(),
                examine: $("#examineCondition").val()
            };
        },
        onLoadSuccess: function (data) {
            //Help.alertSuccMessage("数据加载完毕");
        },
        onLoadError: function (status) {
            // Help.alertErrorMessage("数据加载出错");
        },
        detailView: true, //是否显示详情折叠
        detailFormatter: function (index, row, element) {
            console.log("rows", row);
            let examine;
            if (row.examine === 0) {
                examine = "未审核";
            } else if (row.examine === 1) {
                examine = "审核通过";
            } else if (row.examine === 2) {
                examine = "审核未通过";
            }
            //(row.longitude == null || row.latitude == null) ? +"": (row.longitude+ "," + row.latitude)
            let str =
                "<table style='border: 1px #ff0000 solid'>" +
                "<tr>" +
                "<td>投资规模（元）：" + row.investment + "</td>" +
                "<td>占地面积：" + row.area + "</td>" +
                "<td>地理坐标：" + ((row.longitude == null || row.latitude == null) ? '' : (row.longitude+ "," + row.latitude)) + "</td>" +
                "<td>登录帐号：" + row.loginID + "</td>" +
                "</tr>" +
                "<tr>" +
                "<td>统一信用代码/身份证号：" + row.idCard + "</td>" +
                "<td>审核状态：" + examine + "</td>" +
                "<td>审核意见：" + row.opinion + "</td>" +
                "<td>审核人：" + (row.examineName==null?'':row.examineName) + "</td>" +
                "</tr>" +
                "<tr>" +
                "<td>审核时间：" + (row.examineTime==null?'':row.examineTime) + "</td>" +
                "</tr>" +

                "</table>"

            return str;

        },
        columns: [
            {field: 'enterpriseName', title: '企业名称', align: 'center'},
            {field: 'userName', title: '法人姓名', align: 'center'},
            {field: 'phone', title: '联系电话', align: 'center'},
            {field: 'fullAddress', title: '地址', align: 'center'},
            {field: 'createTime', title: '注册时间', align: 'center'},
            {
                field: 'activity', title: '状态', align: 'center',
                formatter: function (value) {
                    let optionHtml = "";
                    if (value === 0) {
                        optionHtml = "<span class=\"label label-danger custom\" style=\"cursor:pointer\">禁用</span>";
                    } else if (value === 1) {
                        optionHtml = "<span class=\"label label-info\" style=\"cursor:pointer\">启用</span>";
                    }
                    return optionHtml;
                }
            },
            {field: 'remark', title: '备注', align: 'center'},
        ]
    });
    $('#dystable').bootstrapTable({
        url: '/harmlessReportTransport/tableSearchMe/'+$("#kkk").val(),
        method: 'post',
        toolbar: "#toolbar",
        sidePagination: 'server',
        dataField: "data",
        striped: true,
        pagination: true,
        pageNumber: 1,
        pageSize: 10,
        pageList: [10, 25, 50, 100],
        sortable: true,
        sortName: 'createDateTime',
        sortOrder: "desc",
        search: false,
        showRefresh: true,
        showColumns: true,
        showExport: true,
        showToggle: true,
        queryParamsType: 'undefined',
        queryParams: function queryParams(params) {
            return {
                pageSize: params.pageSize,      //页面大小
                pageIndex: params.pageNumber,   //页码
                sort: params.sortName,      //排序列名
                sortOrder: params.sortOrder, //排位命令（desc，asc）
                enterpriseName: $("#enterpriseNameCondition").val(),
                timeInterval:$("#search_TimeInterval").val()
            };
        },
        onLoadSuccess: function (data) {
            //Help.alertSuccMessage("数据加载完毕");
        },
        onLoadError: function (status) {
            // Help.alertErrorMessage("数据加载出错");
        },
        columns: [
            {field: 'createTime', title: '上报日期', align: 'center'},
            {field: 'enterpriseName', title: '上报企业', align: 'center'},
            {field: 'animal', title: '病死畜禽种类', align: 'center'},
            {field: 'dead', title: '病死畜禽数量', align: 'center'},
            {field: 'cause', title: '死亡原因', align: 'center'},
            // {
            //     field: 'status', title: '状态', align: 'center',
            //     formatter: function (value) {
            //         let s;
            //         if (value === 0) {
            //             s = "待上报";
            //         } else if (value === 1) {
            //             s = "待运输";
            //         } else if (value === 2) {
            //             s = "待处理";
            //         } else if (value === 3) {
            //             s = "已处理";
            //         }
            //         return s;
            //     }
            // },
        ]
    });
    $('#dcltable').bootstrapTable({
        url: '/harmlessReportPending/tableSearchMe/'+$("#kkk").val(),
        method: 'post',
        toolbar: "#toolbar",
        sidePagination: 'server',
        dataField: "data",
        striped: true,
        pagination: true,
        pageNumber: 1,
        pageSize: 10,
        pageList: [10, 25, 50, 100],
        sortable: true,
        sortName: 'createDateTime',
        sortOrder: "desc",
        search: false,
        showRefresh: true,
        showColumns: true,
        showExport: true,
        showToggle: true,
        queryParamsType: 'undefined',
        queryParams: function queryParams(params) {
            return {
                pageSize: params.pageSize,      //页面大小
                pageIndex: params.pageNumber,   //页码
                sort: params.sortName,      //排序列名
                sortOrder: params.sortOrder, //排位命令（desc，asc）
                enterpriseName: $("#enterpriseNameCondition").val(),
                timeInterval:$("#search_TimeInterval").val()
            };
        },
        onLoadSuccess: function (data) {
            //Help.alertSuccMessage("数据加载完毕");
        },
        onLoadError: function (status) {
            // Help.alertErrorMessage("数据加载出错");
        },
        columns: [
            {field: 'createTime', title: '上报日期', align: 'center'},
            {field: 'enterpriseName', title: '上报企业', align: 'center'},
            {field: 'animal', title: '病死畜禽种类', align: 'center'},
            {field: 'dead', title: '病死畜禽数量', align: 'center'},
            {field: 'cause', title: '死亡原因', align: 'center'},
            {field: 'transportationTime', title: '运输时间', align: 'center'},
            // {
            //     field: 'status', title: '状态', align: 'center',
            //     formatter: function (value) {
            //         let s;
            //         if (value === 0) {
            //             s = "待上报";
            //         } else if (value === 1) {
            //             s = "待运输";
            //         } else if (value === 2) {
            //             s = "待处理";
            //         } else if (value === 3) {
            //             s = "已处理";
            //         }
            //         return s;
            //     }
            // },
        ]
    });
    $('#cljltable').bootstrapTable({
        url: '/harmlessReportProcessed/tableSearchMe/'+$("#kkk").val(),
        method: 'post',
        toolbar: "#toolbar",
        sidePagination: 'server',
        dataField: "data",
        striped: true,
        pagination: true,
        pageNumber: 1,
        pageSize: 10,
        pageList: [10, 25, 50, 100],
        sortable: true,
        sortName: 'createDateTime',
        sortOrder: "desc",
        search: false,
        showRefresh: true,
        showColumns: true,
        showExport: true,
        showToggle: true,
        queryParamsType: 'undefined',
        queryParams: function queryParams(params) {
            return {
                pageSize: params.pageSize,      //页面大小
                pageIndex: params.pageNumber,   //页码
                sort: params.sortName,      //排序列名
                sortOrder: params.sortOrder, //排位命令（desc，asc）
                enterpriseName: $("#enterpriseNameCondition").val(),
                timeInterval:$("#search_TimeInterval").val()
            };
        },
        onLoadSuccess: function (data) {
            //Help.alertSuccMessage("数据加载完毕");
        },
        onLoadError: function (status) {
            // Help.alertErrorMessage("数据加载出错");
        },
        columns: [
            {field: 'createTime', title: '上报日期', align: 'center'},
            {field: 'enterpriseName', title: '上报企业', align: 'center'},
            {field: 'animal', title: '病死畜禽种类', align: 'center'},
            {field: 'dead', title: '病死畜禽数量', align: 'center'},
            {field: 'cause', title: '死亡原因', align: 'center'},
            {
                field: 'method', title: '处理方式', align: 'center',
                formatter: function (value) { // 0焚烧、1深埋、2化制、3集中无害化处理
                    let s;
                    if (value === 0) {
                        s = "焚烧";
                    } else if (value === 1) {
                        s = "深埋";
                    } else if (value === 2) {
                        s = "化制";
                    } else if (value === 3) {
                        s = "集中无害化处理";
                    }
                    return s;
                }
            },
            {field: 'transportationTime', title: '运输时间', align: 'center'},
            {field: 'processingTime', title: '处理时间', align: 'center'},
            // {
            //     field: 'status', title: '状态', align: 'center',
            //     formatter: function (value) {
            //         let s;
            //         if (value === 0) {
            //             s = "待上报";
            //         } else if (value === 1) {
            //             s = "待运输";
            //         } else if (value === 2) {
            //             s = "待处理";
            //         } else if (value === 3) {
            //             s = "已处理";
            //         }
            //         return s;
            //     }
            // },
        ]
    });

}
